<template>
	<view class="body">
		<xk-header title="专项检查"></xk-header>
		<view class="list" >
			<view class="list-item header" @click="more = !more">
				<view>计划单号:  {{data.plan_no}}</view>
				<image v-if="!more" src="/static/up.png"></image>
				<image v-else  src="/static/down.png"></image>
			</view>
			<view v-if="more" class="data-item">
				<view class="order-info">
					<view class="info-item"><view class="key">计划名称：</view>{{data.plan_name}}</view>
					<view class="info-item"><view class="key">检查内容：</view>{{data.sinspection_content}}</view>
					<view class="info-item"><view class="key">检查日期：</view>{{data.plan_date}}</view>
					<view class="info-item"><view class="key">检查负责人：</view>{{data.inspect_user_name}}</view>
				</view>
			</view>
		</view>

		<view v-if="data.status > '20'" class="list" >
			<view class="list-item header" @click="orderMore = !orderMore">
				<view>检查记录</view>
				<image v-if="!orderMore" src="/static/up.png"></image>
				<image v-else  src="/static/down.png"></image>
			</view>
			<view v-if="orderMore" class="data-item">
				<view class="order-info">
					<view class="info-item"><view class="key">检查人：</view>{{data.inspect_user_name}}</view>
					<view @click="viewDetail" class="info-item" style="justify-content: space-between;">
						<view class="key">检查详情：</view>
						<view style="display: flex; align-items: center;">
							<text class="right-title1" style="color: #2C72FF;">查看明细</text>
							<image mode="aspectFill" class="jiantou" src="/static/jiantou.png"/>
						</view>
					</view>
					<view v-if="data.record_content" class="info-item"><view class="key">检查结果：</view><text>{{data.record_content}}</text></view>
					<view v-else class="info-item"><view class="key">检查结果：</view><text>正常</text></view>
					<view class="info-item"><view class="key">完成时间：</view>{{data.record_date}}</view>
					<view v-if="data.record_image" class="info-item"><view class="key"></view>
						<image-list :pics="data.record_image"></image-list>
					</view>
					<view v-if="data.solution_user_name" class="info-item"><view class="key">整改人：</view><text>{{data.solution_user_name}}</text></view>
					<view v-if="data.solution_content" class="info-item"><view class="key">整改记录：</view><text>{{data.solution_content}}</text></view>
					<view class="info-item"><view class="key">整改时间：</view>{{data.solution_date}}</view>
					<view v-if="data.solution_image" class="info-item"><view class="key"></view>
						<image-list :pics="data.solution_image"></image-list>
					</view>
					<view v-if="data.check_user_name" class="info-item"><view class="key">抽查人：</view><text>{{data.check_user_name}}</text></view>
					<view v-if="data.check_result" class="info-item"><view class="key">抽查结果：</view><text>{{data.check_result == '10' ? '合格' : '不合格'}}</text></view>
					<view v-if="data.check_remark" class="info-item"><view class="key">抽查意见：</view><text>{{data.check_remark}}</text></view>
				</view>
			</view>
		</view>
		<view class="common-bottom-view">
			<view class="common-btn" @click="back">返回</view>
		</view>
		<view class="common-zw"></view>


	</view>
</template>

<script>
	import moment from 'moment'
	export default {
		data() {
			return {
				spectionId: '',
				data: {},
				resultMap: {},
				more: true,
				orderMore: true,
			};
		},
		onLoad(options) {
			this.spectionId = options.spectionId
			this.getData();
		},
		methods:{
			getData(){
				this.$api.baseData_getPmSinspection(this.spectionId).then((res)=>{
					this.data = res.task
				})
			},
			viewDetail(){
				uni.navigateTo({
					url: '/pagesA/special-check/special-check-result-detail?dets=' + JSON.stringify(this.data.dets)
				})
			},
			back(){
				uni.navigateBack()
			}
		}
	}
</script>

<style lang="scss" scoped>
@import '@/common/from.scss';
</style>
